# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=perl-http-daemon
pkgver=6.01
pkgrel=6
pkgdesc="Simple http server class"
arch=('any')
url='https://metacpan.org/pod/HTTP::Daemon'
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-http-date' 'perl-http-message' 'perl-lwp-mediatypes')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/G/GA/GAAS/HTTP-Daemon-${pkgver}.tar.gz
        HTTP-Daemon-6.01-Add-IPv6-support.patch
        HTTP-Daemon-6.01-Handle-undef-and-empty-LocalAddr.patch)
sha256sums=('43fd867742701a3f9fcc7bd59838ab72c6490c0ebaf66901068ec6997514adc2'
            'a4bac445248fb494f88e7189a74f1a5d916ae7778edd089ed5a97e0d443e1ebf'
            '3c46084a36f4a3c3f83e7ed8f4393a6588a5c8d0dbdc948a4f0d6fddc65005ec')

prepare() {
  cd "${srcdir}/HTTP-Daemon-${pkgver}"
  patch -p1 < ../HTTP-Daemon-6.01-Add-IPv6-support.patch
  patch -p1 < ../HTTP-Daemon-6.01-Handle-undef-and-empty-LocalAddr.patch
}

build() {
  cd "${srcdir}/HTTP-Daemon-${pkgver}"
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/HTTP-Daemon-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/HTTP-Daemon-${pkgver}"
  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
